Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project/mentoria spark #9

Open
wants to merge 2 commits into
base: project/mentoria-spark
Choose a base branch
from

Conversation

ivanbarcelos90
Copy link

No description provided.



# bronze to silver function
def bronze_to_silver(bronze_path: str, silver_path: str, schema:str, partition:str, file_type:str):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use o factory pattern para lidar com tipos de leituras diferentes:
https://dagster.io/blog/python-factory-patterns


# Create df
df = (spark.read.option("delimiter", ";")
.option("header", True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use args and kwargs para controlar as opções de leitura dos CSVs. Não é mais necessário passar os parâmetros de leitura como options. Todos podem ser passados dentro do método .csv. Verifique a documentação
https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrameReader.csv.html?highlight=csv#pyspark.sql.DataFrameReader.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants